<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/Cesium/Cesium.js"></script>
    <script src="./js/Cesium/SuperMap3D.js"></script>
    <link rel="stylesheet" href="./js/Cesium/Widgets/widgets.css">
    <style>
        html,
        body,
        #mymap {
            width: 100%;
            height: 100%;
            margin: 0px;
            padding: 0px;
            overflow: hidden;
        }

        .form-container {
            position: absolute;
            left: 10px;
            top: 90px;
            padding: 10px 15px;
            border-radius: 4px;
            border: 1px solid rgba(128, 128, 128, 0.5);
            color: #ffffff;
            background: rgba(0, 0, 0, 0.4);
            box-shadow: 0 3px 14px rgb(128 128 128 / 50%);
            width: 350px;
        }

        button {
            background: transparent;
            border: 1px solid #00d0ffb8;
            color: white;
            padding: 7px 9px;
            border-radius: 2px;
            margin: 3px;
            cursor: pointer
        }

        input {
            width: 100px;
            background: transparent;
            height: 31px;
            border: 1px solid #009ac0;
            color: white;
        }

        .tip-item {
            margin: 2px 0px;
            padding: 5px 1px;
        }
    </style>
</head>

<body>
    <div id="mymap"></div>
    <div class="form-container">
        <div>
            <button onclick="loadniaochao()">加载鸟巢s3m</button>
            <button onclick="isshowniaochao()">清除</button>
        </div>
    </div>
    <script>
        var cesiumAsset = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2MzJjMWZjNi02MmVkLTRkYmUtOGU2ZC0wZDY2ZTAxMzRkMjgiLCJpZCI6MzIxMTYsInNjb3BlcyI6WyJhc2wiLCJhc3IiLCJhc3ciLCJnYyIsInByIl0sImlhdCI6MTU5NjUwOTQ2MX0.gloYT1aON7-sqIUpS82z62k1uE49kfYLmvRon1oxSIM"
        Cesium.Ion.defaultAccessToken = cesiumAsset;
        const terrainProvider = new Cesium.CesiumTerrainProvider({
            url: 'https://www.supermapol.com/realspace/services/3D-stk_terrain/rest/realspace/datas/info/data/path'
        });
        var viewer = new Cesium.Viewer("mymap", {
            infoBox: false,
            selectionIndicator: false,
            navigation: false,
            animation: false,
            shouldAnimate: false,
            timeline: false,
            baseLayerPicker: false,
            geocoder: false,
            homeButton: false,
            sceneModePicker: false,
            navigationHelpButton: false,
            // terrainProvider: terrainProvider,
            imageryProvider: new Cesium.ArcGisMapServerImageryProvider({
                url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",
            }),
        });

        var scene = viewer.scene;
        var promise = null
        function loadniaochao() {
            if (promise) {
                isshowniaochao();
                return;
            }
            promise = viewer.scene.open("http://www.supermapol.com/realspace/services/3D-OlympicGreen/rest/realspace");
        }
        function isshowniaochao() {
            promise.then(function (Layer) {
                for (let index = 0; index < Layer.length; index++) {
                    Layer[index]._visible = !Layer[index]._visible;
                }
            })
        }
    </script>
</body>

</html>